package com.app.jzgdirector;

import android.app.Application;

import com.app.jzgdirector.common.exception.CrashHandler;
import com.common.baselibrary.ApplicationManager;


/**
 * Created by80002037 on 2017/3/31 12:38.
 */

public class MainApplication extends Application {
    private static final String TAG = MainApplication.class.getSimpleName();
    private static MainApplication app;

    @Override
    public void onCreate() {
        super.onCreate();
//        if (BuildConfig.DEBUG) {//debug模式下
//            LeakCanary.install(this);//检测内存泄露,注册
//        }
        app = this;
        if (!BuildConfig.DEBUG) {
            CrashHandler crashHandler = CrashHandler.getInstance();
            crashHandler.init(getApplicationContext());
        }
        ApplicationManager.init(this);


    }

    public static MainApplication getInstance() {
        return app;
    }
}
